package controller;


import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/test")
public class ControllerTest {

    @RequestMapping("/index")
    public String show() {
        System.out.println("Test的index");
        return "face";
    }

    @RequestMapping(value = "/post", method = RequestMethod.POST)
    public String p() {
        System.out.println("表单提交");
        return "result";
    }

    @RequestMapping(value = "/namePwd",
            params = {"name", "password"},
            method = RequestMethod.GET
    )
    public String namePwd(@Validated String name, @Validated String password) {
        System.out.println("用户名和密码");
        System.out.println(name + "  " + password);
        return "face";
    }

}
